//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Globalization;
using System.Windows.Data;

namespace OpenLS.Spreadsheet.UI
{
    class EqualConverter: IValueConverter
    {
        public EqualConverter(object falseValue, object trueValue)
        {
            this.falseValue = falseValue;
            this.trueValue = trueValue;
        }
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
                return false;
            bool result = value.Equals(TrueValue);
            return result;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }

        private object trueValue;

        public object TrueValue
        {
            get { return trueValue; }
            set { trueValue = value; }
        }
        private object falseValue;

        public object FalseValue
        {
            get { return falseValue; }
            set { falseValue = value; }
        }
	
	
        #endregion
    }
}
